package isFascinating;

public class Solution {
    public boolean isFascinating(int n) {
        StringBuilder sb = new StringBuilder();
        sb.append(n);
        sb.append(n*2);
        sb.append(n*3);
        int[] arr=new int[9];
        for (int i = 0; i < sb.length(); i++) {
            int v = sb.charAt(i)-'0';
            if(v==0){
                return false;
            }
            if(arr[v-1]!=0){
                return false;
            }
            arr[v-1] = v;
        }
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]==0){
                return false;
            }
        }
        return true;
    }
}
